<#import "../tpl/pageTep.ftl" as page>
<@page.pageBase currentMenu="用户管理">
<style>
    .button-large {
        font-size: 16px;
    }

    hr {
        border-color: #009688;
    }

    .control-group {
        width: 1000px;
    }

    .webuploader-pick {
        background: none;
        padding: 0;
    }
</style>
<div class="xm-offline">
    <div class="row">
        <div class="panel">
            <div class="panel-header">
                <a href="${basepath}/rest/manage/account/toList">返回上一级</a>
            </div>
            <div class="panel-body">
            <#--form表单提交，相当于data-->
                <form id="editForm" class="form-horizontal" action="${basepath}/rest/manage/user/updateJson"
                      method="post">
                    <input type="hidden" name="id" value="${e.id!}">
                    <div class="control-group">
                        <label class="control-label">
                            微信昵称：
                        </label>
                        <div class="controls">
                            <input type="text" class="control-text span-width span5"
                                   name="nickname"  data-rules="{required:true}" value="${e.nickname!}" disabled="disabled">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">
                            头像：
                        </label>

                        <div class="controls" style="height: auto">
                            <input type="hidden" name="picture" value="${e.icon}"/>
                            <img id="mainPicture" src="${basepath}${e.icon}"
                                 style="max-width: 250px;width: 100%;max-height: 250px;">
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label"> 用户角色：</label>
                        <div class="controls">
                            <input type="text" class="input-normal control-text" name="rank" id="rank" disabled="disabled">
                        </div>
                    </div>
                    <div class=" control-group">
                        <label class="control-label">
                            积分：
                        </label>
                        <div class="controls">
                            <input type="number" class="control-text span-width span5"
                                   name="score" value="${e.score!}"  data-rules="{required:true}">
                        </div>
                    </div>
                    <div class=" control-group">
                        <label class="control-label">
                            余额：
                        </label>
                        <div class="controls">
                            <input type="number" class="control-text span-width span5"
                                   name="balance" value="${e.balance!}"  data-rules="{required:true}">
                        </div>
                    </div>
                    <div class=" control-group">
                        <label class="control-label">
                            收益：
                        </label>
                        <div class="controls">
                            <input type="number" class="control-text span-width span5"
                                   name="income" value="${e.income!}"  data-rules="{required:true}">
                        </div>
                    </div>
                    <div class="centered">
                        <button type="submit" class="button  button-large  button-success">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>


<script type="text/javascript">
    var name=getQueryString('rid');
    switch (name) {
        case '2':
            $("#rank").val('股东');
            break;
        case '3':
            $("#rank").val('会员');
            break;
        case '4':
            $("#rank").val('普通用户');
            break;
    }
    var Grid = BUI.Grid;
    var Select = BUI.Select;
    var Store = BUI.Data.Store;
    var Data = BUI.Data;
    var Calendar = BUI.Calendar;
    var datePicker = new Calendar.DatePicker({
        trigger: '.calendar-time',
        showTime: true,
        autoRender: true
    });
    var editForm = new BUI.Form.Form({
        srcNode: '#editForm',
        submitType: 'ajax',
        callback: function (data) {
            if (data.success == true) {
                window.location.href = "${basepath}/rest/manage/account/toList"
            } else {

            }
        }
    }).render();

</script>

</@page.pageBase>